<template>
  <h2>child4组件 - getter</h2>
  <div>reverseStr: {{ reverseStr }}</div>
</template>

<script>
import { mapState, mapGetters } from "vuex";
export default {
  // computed: mapState(["str"]),
  // computed: mapState({
  //   str: (state) => state.str.split("").reverse().join(""),
  // }),

  // computed: {
  //   reverseStr() {
  //     return this.$store.getters.reverseStr;
  //   },
  // },

  // computed: mapGetters(["reverseStr"]),
  computed: mapGetters({
    reverseStr: "reverseStr",
  }),
};
</script>
